package edu.ucsd.db.bassarisk.algebra.logical;

import java.util.ArrayList;
import java.util.List;

import edu.ucsd.db.bassarisk.algebra.logical.function.Function;
import edu.ucsd.db.bassarisk.algebra.logical.visitor.LogicalOperatorVisitor;

public class ConstantTuple extends LogicalOperator {
  private final List<Function> fields;

  public ConstantTuple(Function field) {
    this.fields = new ArrayList<Function>();
    this.fields.add(field);
  }

  public String toString() {
    return String.format("ConstantTuple(%s)", this.fields);
  }

  public Iterable<Function> fields() {
    return this.fields;
  }

  @Override
  public <R, A> R accept(LogicalOperatorVisitor<R, A> visitor, A arg) {
    return visitor.visitConstantTuple(this, arg);
  }
}
